package leetcode;

public class leetcode104_二叉树最大深度 {

    public int maxDepth(TreeNode root) {
        if (root==null) {
            return 0;
        }
        int Ldepth=maxDepth(root.left);
        int Rdepth=maxDepth(root.right);
        if (Ldepth>Rdepth){
            return Ldepth+1;
        }else{
            return Rdepth+1;
        }




    }

}
